package betdata

import (
	"io/ioutil"
	"strconv"
	"fmt"
)

func WrightFile(period, fcType string, data map[string]int) {
	fileName := "./betdata/" + fcType + ".ini"
	var betStr string
	betStr = "["+fcType+"]\n期数=" + period + "\n下注="
	for k,v := range data{
		betStr = betStr + k + "=" + strconv.Itoa(v) + "@"
	}
	fmt.Println(betStr)
	content := betStr[0 : len(betStr)-1]
	fmt.Println(betStr)
	d1 := []byte(content)
	err := ioutil.WriteFile(fileName, d1, 0666) //写入文件(字节数组)
	fmt.Println(err)
}
